package com.liuzh.fitnessplan.tools

import android.app.Application
import android.content.Context
import androidx.room.Room
import com.liuzh.fitnessplan.database.Database

class RoomDatabaseUtil {
    companion object{
        val instance : RoomDatabaseUtil by lazy { RoomDatabaseUtil() }
    }

    fun getDatabase(context : Context) : Database{
        return Room.databaseBuilder(
            context,
            Database::class.java,
            "User.db")
            .allowMainThreadQueries()
            .build()
    }
}